package com.cheng.example.book.advise151.chap5.client73;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Client73 {

    public static void main(String[] args) {
        List<Employee> list = new ArrayList<Employee>(5);
        // 两个职员
        list.add(new Employee(1004, "马六", Position.Staff));
        list.add(new Employee(1005, "赵七", Position.Staff));
        // 两个经理
        list.add(new Employee(1002, "李四", Position.Manager));
        list.add(new Employee(1003, "王五", Position.Manager));
        // 一个老板
        list.add(new Employee(1001, "张三", Position.Boss));
        // 按照Id排序，也就是按照资历排序
        Collections.sort(list,new PositionComparator());
        for (Employee e : list) {
            System.out.println(e);
        }
    }
}
